package com.example.onlineeducation.mapper

import com.yc.jetpacklib.data.constant.YcNetErrorCode
import com.yc.jetpacklib.exception.YcException
import com.yc.jetpacklib.mapper.IMapper

/**
 * SimpleDes:
 * Creator: Sindi
 * Date: 2022-05-06
 * UseDes:
 */
class SubmitPractiseOptionsMapper : IMapper<List<String>?, List<String>?> {
    override fun map(input: List<String>?): List<String>? {
        return when {
            input == null -> {
                null
            }
            input.isEmpty() -> {
                throw YcException("答案为空", YcNetErrorCode.DATE_NULL_ERROR)
            }
            else -> {
                input
            }
        }
    }
}
